package com.beidouapp.mvc;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.beidouapp.domain.pojo.MonthlySummary;
import com.beidouapp.domain.pojo.Project;
import com.beidouapp.security.model.ReturnDataInfo;
import com.beidouapp.service.MonthlySummaryService;

/**
 *   统计Controller
 */
@Controller
@RequestMapping(value = "/statis")
public class StatisticsController {

    private Logger logger = LoggerFactory.getLogger(StatisticsController.class);
    @Autowired
    MonthlySummaryService monthlySummaryService;
    
    @RequestMapping(value = "/getMonthlyDataStatis", method = RequestMethod.GET )
    public
    @ResponseBody
    ReturnDataInfo<MonthlySummary> getMonthlyDataStatis(HttpServletRequest request ) {
        try {
            List<MonthlySummary> monthlySummaries=monthlySummaryService.getAllMonthlyDataStatis();
            return ReturnDataInfo.createSuccessfulExecuteResults(monthlySummaries);
        } catch (Exception ex) {
        	logger.error("错误："+ex);
            return ReturnDataInfo.createFailedExecuteResult(ex.getMessage());
        }
    }
    

}
